{% extends "base.html" %}
{% block content %}
    <h2>Orchestrator status</h2>
    <p>
      The current orchestrator status is as follows:
      <ul>
        <li>{{ cycles }} cycles have passed
        <li>{{ num_started }} VMs have been started
        <li>{{ num_active }} VMs are currently active (ready for processing jobs)
      </ul>
    </p>
    <!-- table of the started VMs -->
    <h2>Started VMs</h2>
    <table class="table table-striped table-hover">
      <thead>
        <tr>
          <th>ID</th>
          <th>State</th>
          <th>Node name</th>
        </tr>
      </thead>
      <tbody>
        {% for vm in vms %}
        <tr>
          <td>{{ vm.vmid }}</td>
          <td>{{ vm.state }}</td>
          <td>{{ vm.nodename }}</td>
          <td>
            {% if vm.is_not_yet_ready %}
            <a class="btn btn-danger" href="{{ vm.ready_url }}">Mark as ready</a>
            {% endif %}
          </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
{% endblock %}
